﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="RoleView.aspx.cs" Inherits="Wicresoft.RDW.Manage.RoleView" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="/Content/js/jquery.autocomplete.js" type="text/javascript"></script>
    <link href="../Content/css/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
        $(function () {
            $("#<%=lbtnSave.ClientID %>").click(checkAllTextValid);
            $("#<%=lbtnCancle.ClientID %>").click(checkAllTextValid);
            $("#<%=lbtnToLeft.ClientID %>").click(checkAllTextValid);
            $("#<%=lbtnToRight.ClientID %>").click(checkAllTextValid);
        });     
   </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="main_title">
        <h2>
            <%=Resources.NameResource.RolePower%></h2>
    </div>
    <div class="line_gray">
    </div>
    <br />
    <div style="margin: 0 auto; width: 590px">
        <table>
            <tr>
                <td>
                    <asp:Label ID="lblName" runat="server" Width="53px"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtName" runat="server" Width="198" ReadOnly="true"></asp:TextBox><br />
                </td>
                <td colspan="2">
                    <asp:Label ID="lblNameWarn" runat="server" Text="" ForeColor="red"></asp:Label>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <asp:Label ID="lblDesc" runat="server" Text="Label"></asp:Label>:
                </td>
                <td>
                    &nbsp;<asp:TextBox ID="txtDesc" runat="server" TextMode="MultiLine" Width="200" Height="100"></asp:TextBox>
                </td>
                <td>
                </td>
                <td align="center" valign="bottom">
                    <%=Resources.NameResource.Role_User %>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <asp:Label ID="lblUser" runat="server"></asp:Label>:
                </td>
                <td>
                    <asp:ListBox ID="lstLeftAccount" runat="server" Width="205" Height="222"></asp:ListBox>
                </td>
                <td align="center" Width="40px">
                    <asp:LinkButton ID="lbtnToLeft" runat="server" Text="> > >" Font-Bold="true" CausesValidation="false"
                        OnClick="lbtnToRight_OnClick" /><br /><br /><br /><br />
                    <asp:LinkButton ID="lbtnToRight" runat="server" Text="< < <" Font-Bold="true" CausesValidation="false"
                        OnClick="lbtnToLeft_OnClick" />
                </td>
                <td>    
                    <asp:TextBox ID="txtUserAccount" runat="server" Width="195" />
                    <asp:ListBox ID="lstAllAccount" runat="server" Width="200" Height="200"></asp:ListBox>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <div class="sqbtnPane">
                        <p>
                        </p>
                        <p>
                        </p>
                        <p>
                        </p>
                        <p class="sqbtn">
                            <asp:LinkButton ID="lbtnSave" runat="server" Text="Button" OnClick="btnSave_OnClick"
                                CausesValidation="false" /></p>
                        <p>
                        </p>
                        <p class="sqbtn">
                            <asp:LinkButton ID="lbtnCancle" runat="server" Text="Button" OnClick="btnCancle_OnClick"
                                CausesValidation="false" /></p>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <script type="text/javascript">
        var txtUserAccount = $("#<%=txtUserAccount.ClientID %>");
        var lstAllAccount = $("#<%=lstAllAccount.ClientID %>");

        txtUserAccount.keyup(SearchList);

        function SearchList() {
            if (txtUserAccount.val() == "") {
                ClearSelection(lstAllAccount);
            }
            else {
                var options= lstAllAccount.find("option");
                for (var i = 0; i < options.length; i++) {
                    if (options[i].text.toLowerCase().match(txtUserAccount.val().toLowerCase())) {
                        options[i].selected = true;
                        return false;
                    }
                    else {
                        ClearSelection(lstAllAccount);
                    }

                }
            }
        }

        function ClearSelection(lb) {
            $(lb).index(-1);

        }
    </script>
    <%-- <script language="javascript"> var txtAccompanyName = $("#<%=txtUserAccount.ClientID
    %>"); $(function () { loadUsers(); }); function loadUsers() { $.getJSON("/Ajax/Service.ashx?category=GetUserName",
    "", function (data) { txtAccompanyName.focus().autocomplete(data); }); } </script>--%>
</asp:Content>
